<!DOCTYPE html>
<html>
<head>
    <title>领料单详细</title>
    #parse("sys/header.html")
    <style>
        .urgeCss{
            background-color: darkgray;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <i-form ref="formValidate" :model="materialRecord" :rules="ruleValidate" :label-width="80" v-if="flag == 0">
            <Row>
                <i-col span="7">
                    <Form-item label="物料编码" prop="spareCode">
                        <i-input v-model="materialRecord.spareCode" placeholder="请选择备件" icon="md-arrow-dropdown-circle" readonly @click.native="getSpareInfo"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="物料名称" prop="spareName">
                        <i-input v-model="spareName"  disabled ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="规格" prop="spec">
                        <i-input v-model="spec" disabled></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="仓库名称" prop="storeName">
                        <i-input v-model="storeName" disabled></i-input>
                </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="库位编码" prop="postion">
                        <i-input v-model="postion" disabled ></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="7">
                    <Form-item label="库存数量" prop="storeNum">
                        <!--<i-input v-model="storeNum" placeholder="库存数量" number disabled/>-->
                        <input-number v-model="storeNum" :min="1"  placeholder="库存数量" style="width: 100%" disabled></input-number>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="锁定数量" prop="locNum">
                        <!--<i-input v-model="locNum" placeholder="锁定数量" number :minlength="0" disabled />-->
                        <input-number v-model="locNum" :min="1"  placeholder="锁定数量" style="width: 100%" disabled></input-number>
                    </Form-item>
                </i-col>
                <i-col span="7">
                    <Form-item label="领用数量" prop="num">
                        <input-number v-model="materialRecord.num" :min="1" :max="storeNum-locNum" placeholder="领用数量" style="width: 100%"></input-number>
                        <!--<i-input v-model="materialRecord.num" placeholder="领用数量" number :minlength="1" />-->
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                #if($shiro.hasPermission("spareMater:save"))
                <i-button type="primary" @click="handleSubmit('formValidate')"><i class="fa fa-plus"></i> 添加</i-button>
                #end
                <!--<i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>-->
            </Form-item>
        </i-form>

    </div>

    <Card v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.spareCode" @on-enter="query" placeholder="备件编码"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;" v-if="flag!=1">
            <div class="buttons-group" >
                #if($shiro.hasPermission("spareMater:save"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>

        <table id="jqGrid"></table>
    </Card>
</div>

<script src="${rc.contextPath}/js/spare/sparematerialrecord.js?_${date.systemTime}"></script>
</body>
</html>
